package com.itstudio.portal.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itstudio.portal.entity.Exchanges;
import com.itstudio.portal.entity.vo.ExchangesVo;
import com.itstudio.portal.mapper.ExchangesMapper;
import com.itstudio.portal.service.ExchangesService;
import com.itstudio.portal.utils.BeanCopyUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 存储各个数据交易所的相关信息(Exchanges)表服务实现类
 *
 * @author makejava
 * @since 2024-12-18 20:08:51
 */
@Service("exchangesService")
public class ExchangesServiceImpl extends ServiceImpl<ExchangesMapper, Exchanges> implements ExchangesService {
  
  
    @Resource
    private ExchangesMapper exchangeMapper;
  
    @Override
    public List<ExchangesVo> getAllList() {



        //查询出来所有的交易所
        List<Exchanges> list = list();
        ArrayList<ExchangesVo> exchangesVoList = new ArrayList<>();
        for (Exchanges exchanges : list) {
            ExchangesVo exchangesVo = BeanCopyUtil.classVo(exchanges, ExchangesVo.class);
            String longitude = exchanges.getLongitude();
            String latitude = exchanges.getLatitude();
            exchangesVo.setCoord(Arrays.asList(longitude,latitude));
            exchangesVoList.add(exchangesVo);
        }



        return exchangesVoList;



    }
}
